Don't make an empty track a the start of each track download from Garmin. Don't...
authorrobertl <robertl>
Fri, 9 Apr 2010 16:32:29 +0000 (16:32 +0000)
committerrobertl <robertl>
Fri, 9 Apr 2010 16:32:29 +0000 (16:32 +0000)
garmin.c
jeeps/gpsapp.c

index 5f232c259af87996120969d144e2d28803081104..62cf3fca0b36cc857e70fe31158ccaa4ee5a20fa 100644 (file)
--- a/garmin.c
+++ b/garmin.c
@@ -454,7 +454,8 @@ track_read(void)
                }
 
 
-               if ((trk_head == NULL) || array[i]->tnew) {
+               if (trk_head == NULL || array[i]->ishdr
+                   || (array[i]->tnew && i > 0 && !array[i - 1]->ishdr)) {
                        trk_head = route_head_alloc();
                        trk_head->rte_num = trk_num;
                        if (trk_seg_num == 1) {
@@ -1050,7 +1051,6 @@ route_write(void)
 static void
 track_hdr_pr(const route_head *trk_head)
 {
-       (*cur_tx_tracklist_entry)->tnew = gpsTrue;
        (*cur_tx_tracklist_entry)->ishdr = gpsTrue;
        if ( trk_head->rte_name ) {
                strncpy((*cur_tx_tracklist_entry)->trk_ident, trk_head->rte_name, sizeof((*cur_tx_tracklist_entry)->trk_ident));
index f14153fc17355c9ceffa3a3772a11868a27ad292..81dc8e1c3f537eb7066f73be503871c5a1a498ac 100644 (file)
@@ -4397,7 +4397,6 @@ void GPS_D311_Get(GPS_PTrack *trk, UC *s)
     /* Forerunner */
     identifier = GPS_Util_Get_Short(s);
     sprintf((*trk)->trk_ident, "%d", identifier);
-    (*trk)->tnew = 1;
 
     return;
 }